package com.ck.express.db.dao

import com.ck.express.db.entity.FailedLatticeRequest
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

class FailedLatticeRepository @Inject constructor(
    private val dao: FailedLatticeRequestDao
) {
    // 添加分页参数
    suspend fun getAllFailedLatticeRequests(page: Int = 0, size: Int = DEFAULT_PAGE_SIZE): List<FailedLatticeRequest> {
        return dao.getFailedRequestsByPage(page, size)
    }

    suspend fun getAllFailedRequests(): Flow<List<FailedLatticeRequest>> {
        return dao.getAllFailedRequests()
    }

    companion object {
        private const val DEFAULT_PAGE_SIZE = 20
    }
}